import React, { useState } from 'react';
import { Table, Radio, Divider, Space } from 'dw-mx';
import {Code} from "dw-mx-extend";
import { SelectCell, StringCell } from 'dw-mx-table';
const { Column } = Table;

export default function ReadonlySelect() {
    Code.NAMEDCODE.set({
        "XB":[{value:"1",content:"男"},{value:"2",content:"女"}],
    })
    const data = [
        {
            key: '1',
            level: "1",
            mz: 2,
            xb: 1,
            ywlx:[1,2,3],
        }
    ];

    return (
        <Table scroll={{ x: 880 }} dataSource={data} bordered>
            <Column ellipsis={true} title="序号" key="no" align={'center'} width={40}
                    render={(value, record, index) => {
                        return <StringCell value={index+1}/>;
                    }}/>
            <Column ellipsis={true} title="学历" dataIndex="level" key="level" align={'center'} width={120}
                    render={(value, record, index) => {
                        return <SelectCell value={value} align={"right"} options={Code.STRINGCODE("1:本科,2:硕士")} style={{color:'red'}}/>;
                    }}/>
            <Column ellipsis={true} title="民族" dataIndex="mz" key="mz" align={'center'} width={120}
                    render={(value, record, index) => {
                        return <SelectCell value={value} align={"left"} options={Code.JSONCODE([{value: "2", content: "汉族"}])}/>;
                    }}/>
            <Column ellipsis={true} title="性别" dataIndex="xb" key="xb" align={'center'} width={120}
                    render={(value, record, index) => {
                        return <SelectCell value={value} align={"left"} options={Code.NAMEDCODE.get("XB")}/>;
                    }}/>
            <Column ellipsis={true} title="业务类型" dataIndex="ywlx" key="ywlx" align={'center'} width={120}
                    render={(value, record, index) => {
                        return <SelectCell value={value} align={"center"} separator={"/"} options={Code.STRINGCODE('1:计划建立,2:待遇支付,3:缴费管理,4:交易处理,5:交易处理,6:匹配处理,7:计划管理,8:单位管理,9:人员管理,10:考核管理')}/>;
                    }}/>
        </Table>
    );
}